<template>
  <div class="home">
    <el-container>
      <el-aside width="200px">
        <el-menu
          :default-active="activeIndex"
          class="el-menu-vertical"
          @select="handleSelect"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b">
          <el-menu-item index="1" @click="$router.push('/')">
            <el-icon><HomeFilled /></el-icon>
            <span>首页</span>
          </el-menu-item>
          <el-menu-item index="2" @click="$router.push('/task-schedule')">
            <el-icon><Calendar /></el-icon>
            <span>任务调度</span>
          </el-menu-item>
          <el-menu-item index="3" @click="$router.push('/manual-trigger')">
            <el-icon><Operation /></el-icon>
            <span>手动触发</span>
          </el-menu-item>
          <el-menu-item index="4" @click="$router.push('/monitor-status')">
            <el-icon><Monitor /></el-icon>
            <span>监控状态</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      
      <el-container>
        <el-header>
          <h2>自动化测试平台</h2>
        </el-header>
        
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { HomeFilled, Calendar, Operation, Monitor } from '@element-plus/icons-vue'

const activeIndex = ref('1')

const handleSelect = (key) => {
  activeIndex.value = key
}
</script>

<style scoped>
.home {
  height: 100vh;
}

.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
  text-align: center;
}

.el-aside {
  background-color: #545c64;
  color: #333;
  height: 100vh;
}

.el-menu {
  border-right: none;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  padding: 20px;
}
</style>
